home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / ear / mui23dev.lha / MUI / Developer / C / Examples / Pages.c < prev    next >
C/C++ Source or Header  |  1994-12-23  |  2KB  |  101 lines

  1. #include "demo.h"
  2.  
  3. static char *Sex[]     = { "male","female",NULL };
  4. static char *Pages[]   = { "Race","Class","Armor","Level",NULL };
  5. static char *Races[]   = { "Human","Elf","Dwarf","Hobbit","Gnome",NULL };
  6. static char *Classes[] = { "Warrior","Rogue","Bard","Monk","Magician","Archmage",NULL };
  7.  
  8. int main(int argc,char *argv[])
  9. {
  10.     APTR app,window;
  11.     ULONG signals;
  12.     BOOL running = TRUE;
  13.  
  14.     init();
  15.  
  16.     app = ApplicationObject,
  17.         MUIA_Application_Title      , "Pages-Demo",
  18.         MUIA_Application_Version    , "$VER: Pages-Demo 10.11 (23.12.94)",
  19.         MUIA_Application_Copyright  , "©1992/93, Stefan Stuntz",
  20.         MUIA_Application_Author     , "Stefan Stuntz",
  21.         MUIA_Application_Description, "Show MUIs Page Groups",
  22.         MUIA_Application_Base       , "PAGESDEMO",
  23.  
  24.         SubWindow, window = WindowObject,
  25.             MUIA_Window_Title, "Character Definition",
  26.             MUIA_Window_ID   , MAKE_ID('P','A','G','E'),
  27.  
  28.             WindowContents, VGroup,
  29.  
  30.                 Child, ColGroup(2),
  31.                     Child, Label2("Name:"), Child, String("Frodo",32),
  32.                     Child, Label1("Sex:" ), Child, Cycle(Sex),
  33.                     End,
  34.  
  35.                 Child, VSpace(2),
  36.  
  37.                 Child, RegisterGroup(Pages),
  38.                     MUIA_Register_Frame, TRUE,
  39.  
  40.                     Child, HCenter(Radio(NULL,Races)),
  41.  
  42.                     Child, HCenter(Radio(NULL,Classes)),
  43.  
  44.                     Child, HGroup,
  45.                         Child, HSpace(0),
  46.                         Child, ColGroup(2),
  47.                             Child, Label1("Cloak:" ), Child, CheckMark(TRUE),
  48.                             Child, Label1("Shield:"), Child, CheckMark(TRUE),
  49.                             Child, Label1("Gloves:"), Child, CheckMark(TRUE),
  50.                             Child, Label1("Helmet:"), Child, CheckMark(TRUE),
  51.                             End,
  52.                         Child, HSpace(0),
  53.                         End,
  54.  
  55.                     Child, ColGroup(2),
  56.                         Child, Label("Experience:"  ), Child, Slider(0,100, 3),
  57.                         Child, Label("Strength:"    ), Child, Slider(0,100,42),
  58.                         Child, Label("Dexterity:"   ), Child, Slider(0,100,24),
  59.                         Child, Label("Condition:"   ), Child, Slider(0,100,39),
  60.                         Child, Label("Intelligence:"), Child, Slider(0,100,74),
  61.                         End,
  62.  
  63.                     End,
  64.                 End,
  65.             End,
  66.         End;
  67.  
  68.     if (!app)
  69.         fail(app,"Failed to create Application.");
  70.  
  71.     DoMethod(window,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,
  72.         app,2,MUIM_Application_ReturnID,MUIV_Application_ReturnID_Quit);
  73.  
  74.  
  75. /*
  76. ** Input loop...
  77. */
  78.  
  79.     set(window,MUIA_Window_Open,TRUE);
  80.  
  81.     while (running)
  82.     {
  83.         switch (DoMethod(app,MUIM_Application_Input,&signals))
  84.         {
  85.             case MUIV_Application_ReturnID_Quit:
  86.                 running = FALSE;
  87.                 break;
  88.         }
  89.         if (running && signals) Wait(signals);
  90.     }
  91.  
  92.     set(window,MUIA_Window_Open,FALSE);
  93.  
  94.  
  95. /*
  96. ** Shut down...
  97. */
  98.  
  99.     fail(app,NULL);
  100. }
  101.